import { axios } from "../../utils/request";

const api = {
    detail: "/crm/webConfig/detail",
    save: "/crm/webConfig/save",
    saveImage: "/crm/webConfig/saveWebImage",
    webImageList: "/crm/webConfig/webImageList",
    deleteImg: "/crm/webConfig/deleteImg",
    getCommissionConfig: "/crm/webConfig/getCommissionConfig" 
};

/**
 * 详情
 */
export function detail(parameter) {
  return axios({
    url: api.detail,
    method: "get",
    params: parameter
  });
}

/**
 * 保存
 */
export function save(parameter) {
  return axios({
    url: api.save,
    method: "post",
    data: parameter
  });
}

/**
 * 保存图片
 */
export function saveImage(data) {
  return axios({
    url: api.saveImage,
    method: "post",
    data: data
  });
}

/**
 * 获取图片地址
 */
export function webImageList(data) {
  return axios({
    url: api.webImageList,
    method: "get",
    params: data
  });
}

/**
 * 删除图片地址
 */
export function deleteImg(data) {
  return axios({
    url: api.deleteImg,
    method: "post",
    data: data
  });
}

/**
 * 获取佣金配置
 */
export function getCommissionConfig(data) {
  return axios({
    url: api.getCommissionConfig,
    method: "get",
    params: data
  });
}